package cn.yz.fresh.dao.impl;

import cn.yz.fresh.dao.ICategoryDAO;
import cn.yz.fresh.pojo.Category;
import cn.yz.fresh.pojo.Grade;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Kim昌完 on 2017/8/31.
 */
@Repository
public class CategoryDAOImpl extends SqlSessionDaoSupport implements ICategoryDAO{
    @Override
    public List<Category> queryAllCategory(Grade grade) {
        List<Category> categoryList = super.getSqlSession().selectList("cn.yz.fresh.pojo.queryAllByGradeId", grade.getGradeId());
        return categoryList;
    }
}
